package it.koutifaris.travianmap.view.playerdetails;

import it.koutifaris.travianmap.R;
import it.koutifaris.travianmap.context.ContextRetreiver;
import it.koutifaris.travianmap.model.Player;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class PlayerDetailsActivity extends Activity {

	private static class Arguments {
		private static Player player;
	}

	public static void startActivity(Player player) {
		Arguments.player = player;

		Activity currentActivity = ContextRetreiver.contextRetreiver().getCurrentContext().getActivity();
		Intent intent = new Intent(currentActivity, PlayerDetailsActivity.class);
		currentActivity.startActivity(intent);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ContextRetreiver.contextRetreiver().setCurrentContext(this);

		setContentView(R.layout.player_details);

		new PlayerDetailsInitializer(Arguments.player).initView(new PlayerDetailsViewImpl());
	}
}
